home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************************************/
- /* */
- /* Program Name: Stiletto */
- /* */
- /* File Name: CHRSModulesGlue.c */
- /* */
- /* © Apple Computer, Inc. 1991-1995 */
- /* All Rights Reserved */
- /* */
- /* Revision History: */
- /* */
- /* Date Who Modification */
- /* */
- /* 1991-09-28 Chris Halim Original version */
- /* 1995-06-26 Jaakko Railo Version 2.0 */
- /* */
- /************************************************************************************************/
-
- /****************************************** DESCRIPTION ******************************************
-
- *************************************************************************************************/
-
- /******************************************** HEADERS *******************************************/
-
- #ifndef __STDARG__
- #include "stdarg.h"
- #endif
-
- #ifndef __TELEPHONES__
- #include "Telephones.h"
- #endif
-
- #ifndef __CHRSMODULES__
- #include "CHRSModules.h"
- #endif
-
- /****************************************** DEFINITIONS *****************************************/
-
- /****************************************** PROTOTYPES ******************************************/
-
- /******************************************** GLOBALS *******************************************/
-
- /************************************************************************************************/
- /************************************************************************************************/
-
-
- pascal TELHandle GetCurrentTELHandle (CHRSPtr paramPtr)
- {
- paramPtr->request = getCurrentTELHandleRequest;
-
- CallEntryPointProc ((EntryPointProcPtr) paramPtr->entryPoint, paramPtr);
-
- return ((TELHandle) paramPtr->outArgs[0]);
- }
-
-
- pascal TELCAHandle GetCAHandle (CHRSPtr paramPtr)
- {
- paramPtr->request = getCAHandleRequest;
-
- CallEntryPointProc ((EntryPointProcPtr) paramPtr->entryPoint, paramPtr);
-
- return ((TELCAHandle) paramPtr->outArgs[0]);
- }
-
-
- pascal TELDNHandle GetDNHandle (CHRSPtr paramPtr)
- {
- paramPtr->request = getDNHandleRequest;
-
- CallEntryPointProc ((EntryPointProcPtr) paramPtr->entryPoint, paramPtr);
-
- return ((TELDNHandle) paramPtr->outArgs[0]);
- }
-
-
- void Print (CHRSPtr paramPtr, const char * format, ...)
- {
- va_list ap;
-
- va_start (ap, format);
- paramPtr->request = printRequest;
- paramPtr->inArgs[0] = (long) format;
- paramPtr->inArgs[1] = (long) ap;
-
- CallEntryPointProc ((EntryPointProcPtr) paramPtr->entryPoint, paramPtr);
-
- va_end (ap);
- }
-
-
- void BlinkItem (DialogPtr theDialog, short itemNumber)
- {
- short itemKind;
- Handle itemHand;
- Rect itemRect;
- long finalTicks;
-
- GetDItem (theDialog, itemNumber, &itemKind, &itemHand, &itemRect);
-
- HiliteControl ((ControlHandle) itemHand, 1);
- Delay (8, &finalTicks);
- HiliteControl ((ControlHandle) itemHand, 0);
- }
-
-
- pascal Boolean StandardFilterProc(DialogPtr theDialog, EventRecord * theEvent, short * itemHit)
- {
- Boolean wasHandled = false;
- char key;
-
- switch (theEvent->what) {
- case keyDown :
- key = theEvent->message & charCodeMask;
-
- switch (key) {
- case '.' :
- if (theEvent->modifiers & cmdKey) {
- *itemHit = cancel;
- BlinkItem (theDialog, *itemHit);
- wasHandled = true;
- }
- break;
-
- case 0x1B : // Esc
- *itemHit = cancel;
- BlinkItem (theDialog, *itemHit);
- wasHandled = true;
- break;
-
- case 0x0D : // CR
- case 0x03 : // Enter
- *itemHit = ok;
- BlinkItem (theDialog, *itemHit);
- wasHandled = true;
- break;
- }
- }
-
- return (wasHandled);
- }
-